package com.chuan.it_market.controller;


import com.chuan.it_market.service.TypeService;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.annotation.Resource;

@Controller
public class IndexController {




    @Resource
    TypeService typeService;

    //@ResponseBody//表示放回json字符串给前端
    @RequestMapping("/")
    String index(Model model){
        model.addAttribute("alltypes",typeService.selectAllType());
        return"index";
    }
}
